<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台登录-X-admin2.0</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    @include("admin.public.style")
    @include("admin.public.script")

    {{--引入验证码js--}}
    <script src="/static/utils/validate_code.js"></script>
    {{--js验证码--}}
    <script type="text/javascript"> drawCode('test','hidden_code');  </script>

</head>
<body class="login-bg">

    {{--主体内容--}}
    <div class="login layui-anim layui-anim-up">
        <div class="message">后台管理登录</div>

        {{--错误信息提示栏--}}
        @if(count($errors) > 0)
            <div class="alert alert-danger">
                <ul>
                    @if(is_object($errors))
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    @else
                        <li>{{ $errors }}</li>
                    @endif
                </ul>
            </div>
        @endif


        {{--表单信息--}}
        <form method="post" class="layui-form" action="{{ url('/admin/doLogin') }}" >
            {{--csrf表单跨站访问--}}
            {{ csrf_field()  }}
            <input name="username" placeholder="用户名" title="请输入用户名" type="text" autocomplete="new-password" lay-verify="required" class="layui-input" maxlength="30">
            <hr class="hr15">
            <input name="password" lay-verify="required"  title="密码长度必须在6-18位之间" autocomplete="new-password" placeholder="密码"  type="password" class="layui-input" maxlength="18">
            <hr class="hr15">
            <input name="code" style="width:150px" lay-verify="required" placeholder="验证码"  type="text" class="layui-input" maxlength="4">
            <input name="hidden_code" id="hidden_code" style="width:150px" type="hidden" class="layui-input">
            <canvas id="test" width="120" height="50" style="display:inline-block;margin-top:-50px;float:right"> </canvas>
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            {{--lay-submit可以在前端验证--}}
            <hr class="hr20" >
        </form>
    </div>

    {{--js验证码--}}
    <script type="text/javascript">
        window.onload =  drawCode('test','hidden_code');
    </script>
</body>
</html>
